<template>
  <!--授权弹窗-->
  <van-action-sheet :show="show" :closeable="false">
    <div class="action-con" @click.stop>
      <p class="title">获取您的个人信息</p>
      <div class="text-con">
        <p>
          为了便于您使用广州蓝鼎网络有限公司的服务，中国银行将您的以下信息传递给广州蓝鼎网络有限公司。您通过第三方服务商主动提供给第三方商户的个人信息，相关信息保护责任由第三方商户承担。</p>
        <p class="info"><span></span>所属机构编号</p>
        <p class="info"><span></span>用户标识</p>
        <div class="checkbox-con" @click="checkedShow">
          <van-checkbox class="checkbox-btn" v-model="userInfo.haveReadState" shape="square" disabled></van-checkbox>
          <p class="checkbox-text">
            我已阅读并同意<span>《广州蓝鼎科技有限公司隐私政策》、《活动规则》</span></p>
        </div>
      </div>
      <div class="close-btn" @click="handleAllowBtn">允许</div>
      <div class="close-text" @click="handleShow">拒绝</div>
    </div>
  </van-action-sheet>
</template>

<script setup>
import {defineProps, ref, watch} from "vue";
import useUser from "@/store/user.js";

const userInfo = useUser()
const props = defineProps({
  show: {
    type: Boolean,
    default: false
  }
})


const emits = defineEmits(['handleClose', 'handleCheckedShow', 'handleAllowChange'])

const handleShow = () => {
  emits("handleClose")
}
const checkedShow = () => {
  // userInfo.haveReadState = true
  emits("handleCheckedShow")
}

const handleAllowBtn = () => {
  emits("handleAllowChange")
}
</script>

<style lang="scss" scoped>


.action-con {
  width: 100%;
  min-height: 920px;
  padding: 54px 24px;
  box-sizing: border-box;

  .title {
    font-size: 36px;
    font-weight: bold;
    line-height: 1.5em;
    color: #000000;
    text-align: left;
  }

  .text-con {
    margin-top: 40px;

    p {
      text-align: justify;
      font-size: 32px;
      color: #666666;
      line-height: 1.5em;
      font-weight: 500;
    }

    .info {
      margin-top: 10px;
      text-align: left;
      display: flex;
      align-items: center;

      span {
        margin-right: 15px;
        width: 8px;
        height: 8px;
        background-color: #666666;
        border-radius: 50%;
      }
    }

    .checkbox-con {
      margin-top: 10px;

      .checkbox-btn {
        margin-top: 4px;
        float: left;
        --van-checkbox-size: 28px;

      }

      .checkbox-text {
        text-indent: 20px;
        font-size: 28px;
        font-weight: 500;
        line-height: 1.5em;
        color: #666666;

        span {
          color: #2a70e9;
          text-decoration: underline #2a70e9;
        }
      }
    }
  }

  .close-btn {
    margin: 75px auto 0;
    width: 630px;
    height: 85px;
    line-height: 85px;
    text-align: center;
    background-color: #2a70e9;
    border-radius: 16px;
    font-size: 34px;
    font-weight: 600;
    color: #ffffff;
  }

  .close-text {
    margin: 10px auto 0;
    width: 630px;
    height: 85px;
    line-height: 85px;
    text-align: center;
    border-radius: 16px;
    font-size: 34px;
    font-weight: 600;
    color: #2a70e9;
  }

  .close-text:hover {
    background-color: rgba(42, 112, 233, 0.2);
  }
}
</style>
